<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>选妃系统</title>
		<style type="text/css">
			*{
				margin: 0px;
				padding: 0px;
			}
			#container{
				width: 100%;
				height: 600px;
				display: flex;
				justify-content: center;
				align-items: center;
			}
			#outDiv{
				width: 600px;
				height: 500px;
				display: flex;
				align-items: center;
				overflow: hidden;
			}
			#imgAll{
				display: flex;
				width: 1600px;
				height: 100px;
			}
			#imgAll img{
				width: 100px;
				height: 100px;
			}
		</style>
	</head>
	<body>
		<div id="container">
			<div id="outDiv">
				<div id="imgAll" >
					<img src="img/1.webp" >
					<img src="img/2.webp" >
					<img src="img/3.webp" >
					<img src="img/4.webp" >
					<img src="img/5.webp" >
					<img src="img/6.webp" >
					<img src="img/7.webp" >
					<img src="img/8.webp" >
					<img src="img/9.webp" >
					<img src="img/10.webp" >
					<img src="img/1.webp" >
					<img src="img/2.webp" >
					<img src="img/3.webp" >
					<img src="img/4.webp" >
					<img src="img/5.webp" >
					<img src="img/6.webp" >
				</div>
				<div id="imgDom">
					
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		var imgobj = document.getElementById('imgAll');
		var mar = 0;
		var stop = null;
		var begin = true;
		document.getElementById('imgAll').onmouseenter = function(){
			begin = false; 
		}
		
		document.getElementById('imgAll').onmouseleave = function(){
			begin = true;
		}
		
		function imgAction (){
			if(!begin){
				return;
			}
			mar--;
			imgobj.style.marginLeft = mar +'px';
			if(mar==-100*10){
				mar = 0;
				}
				if(mar%100==0){
					clearInterval(myInterval);
					setTimeout(function(){
						myInterval = setInterval(imgAction,10);
					},500)}
					
					else{
						imgobj.style.marginLeft = mar +'px';
			}
		}
			
			
		onload = function(){
		myInterval = setInterval(imgAction,10);
		}
		
	</script>
</html>
